home *** CD-ROM | disk | FTP | other *** search
- #include "defs.h"
-
- #define MAX_CON 2
-
- UCHAR CHK_VRAM = 1;
- UCHAR ACT_DSP = FALSE;
- SHORT ACT_CON = 0;
- SHORT DSP_CON = 0;
- SHORT ACT_CVRAM=0xC800;
- SHORT ACT_KVRAM=0xCA00;
- SHORT CUR_OLD_XY = 0xFFFF;
- SHORT CUR_DISP_X = 0;
- SHORT CUR_DISP_Y = 0;
- SHORT CUR_DISP_OFF = 14;
- SHORT CUR_DISP_SIZ = 2;
- UCHAR CUR_DISP_FLG = 0;
- CONPARA consol[MAX_CON]={
- {
- 0xC800, /* cvram */
- 0xCA00, /* kvram */
- 0, /* cur_x */
- 0, /* cur_y */
- 0x30, /* cur_type */
- 14, /* cur_off */
- 2, /* cur_siz */
- 0, /* cur_flg */
- 0xCE, /* com_mode */
- MAX_Y, /* scr_y */
- 7, /* color */
- 0, /* bakcol */
- FALSE, /* tabflg */
- TRUE, /* odr_flg */
- TRUE, /* kanmod */
- 0, /* bakch1 */
- 0, /* kancod */
- FALSE, /* extflg */
- 0, /* esccnt */
- 0, /* bak_x */
- 0, /* bak_y */
- 0, /* (*extpro)() */
- { 0 }, /* tabmap[MAX_X/8] */
- { 0 }, /* escprm[ESPSIZ] */
- },
- {
- 0xC800, /* cvram */
- 0xCA00, /* kvram */
- 0, /* cur_x */
- 0, /* cur_y */
- 0x30, /* cur_type */
- 14, /* cur_off */
- 2, /* cur_siz */
- 0, /* cur_flg */
- 0xCE, /* com_mode */
- MAX_Y, /* scr_y */
- 7, /* color */
- 0, /* bakcol */
- FALSE, /* tabflg */
- TRUE, /* odr_flg */
- TRUE, /* kanmod */
- 0, /* bakch1 */
- 0, /* kancod */
- FALSE, /* extflg */
- 0, /* esccnt */
- 0, /* bak_x */
- 0, /* bak_y */
- 0, /* (*extpro)() */
- { 0 }, /* tabmap[MAX_X/8] */
- { 0 }, /* escprm[ESPSIZ] */
- }
- };
- REGSET far *regs;
- CONPARA *actv=consol;
-
- /**************************************************************
- CONSOL BIOS (int 91h)
- ***************************************************************/
- void VDB_00(void) /* 初期化 */
- {
- SCR_Y = MAX_Y - 1;
- CUR_FLG = 0;
- COM_MODE = 0xCE;
- CUR_X = CUR_Y = 0;
- COLOR = 7;
- colset(0,COLOR,(MAX_X * 2) * MAX_Y);
- Con_init();
- }
- void VDB_01(void)
- {
- } /* 画面の表示制御 */
-
- void VDB_02(void) /* 全画面消去 */
- {
- colset(0,COLOR,(MAX_X * 2) * MAX_Y);
- CUR_X = CUR_Y = 0;
- }
- void VDB_03(void) /* 表示画面サイズの設定 */
- {
- if ( (SCR_Y = U_DH) > MAX_Y )
- SCR_Y = MAX_Y;
- if ( (COM_MODE & 0x40) != 0 )
- SCR_Y--;
- }
- void VDB_04(void) /* 表示画面サイズの読み取り */
- {
- U_DL = SCR_X;
- U_DH = SCR_Y;
- }
- void VDB_05(void) /* 表示画面サイズレパ-トリの読み取り */
- {
- union {
- UCHAR far *p;
- unsigned short s[2];
- } ptr;
-
- ptr.s[0] = U_DI;
- ptr.s[1] = U_DS;
-
- if ( *(ptr.p++) < 4 )
- return;
- *(ptr.p++) = 1;
- *(ptr.p++) = 80;
- *(ptr.p++) = 25;
- }
- void VDB_06(void) /* アトリビュート機能範囲の読み取り */
- {
- union {
- UCHAR far *p;
- unsigned short s[2];
- } ptr;
-
- ptr.s[0] = U_DI;
- ptr.s[1] = U_DS;
-
- *(ptr.p++) = 0x03; /* 漢字識別可能 */
- *(ptr.p++) = 0x38; /* リバ-ス & 強調 */
- *(ptr.p++) = 0x07; /* 最大色数 */
- *(ptr.p) = 0;
- }
- void VDB_07(void) /* フォントパタ-ンの取り出し */
- {
- int i;
- union {
- UCHAR far *p;
- unsigned short s[2];
- } ptr,fnt;
-
- ptr.s[0] = U_DI;
- ptr.s[1] = U_DS;
-
- if ( U_BH == 0 ) { /* ANK 8x8 or 8x16 */
- if ( U_DH != 8 )
- goto ERROR;
- else if ( U_DL == 8 ) {
- fnt.s[0] = U_BL * 8;
- fnt.s[1] = 0xCA00;
- outp(0xFF99,1);
- for ( i = 0 ; i < 8 ; i++ )
- *(ptr.p++) = *(fnt.p++);
- outp(0xFF99,0);
- return;
- } else if ( U_DL == 16 ) {
- fnt.s[0] = U_BL * 16;
- fnt.s[1] = 0xCB00;
- outp(0xFF99,1);
- for ( i = 0 ; i < 16 ; i++ )
- *(ptr.p++) = *(fnt.p++);
- outp(0xFF99,0);
- return;
- } else
- goto ERROR;
- } else if ( U_DX == 0x1010 ) { /* Kanji 16x16 */
- outp(0xFF94,U_BL);
- outp(0xFF95,U_BH);
- for ( i = 0 ; i < 16 ; i++ ) {
- *(ptr.p++) = inp(0xFF96);
- *(ptr.p++) = inp(0xFF97);
- }
- return;
- }
- ERROR:
- U_AH = 0x02;
- U_CF |= 0x0001;
- }
- void VDB_08(void) /* 外字パタ-ンの登録 */
- {
- }
- void VDB_09(void) /* カ-ソル形状の設定 */
- {
- switch(U_AL & 0x0F) {
- case 0: CUR_OFF = 14; CUR_SIZ = 2; break;
- case 1: CUR_OFF = 0; CUR_SIZ = 16; break;
- case 15: CUR_OFF = U_DH;
- CUR_SIZ = U_DL - CUR_OFF;
- if ( CUR_OFF < 0 || CUR_OFF > 15 )
- CUR_OFF = 15;
- if ( CUR_SIZ < 0 || (CUR_SIZ + CUR_OFF) > 16 )
- CUR_SIZ = 16 - CUR_OFF;
- break;
- }
- CUR_FLG = ((U_AL & 0x60) == 0x20 ? 1:0);
- CUR_TYPE = U_AL;
- CUR_OLD_XY = 0xFFFF;
- }
- void VDB_0A(void) /* カ-ソル形状の読み取り */
- {
- U_AL = CUR_TYPE;
- U_DH = CUR_OFF;
- U_DL = CUR_OFF + CUR_SIZ;
- }
- void VDB_0B(void) /* カ-ソル表示状態の設定 */
- {
- CUR_FLG = U_AL;
- }
- void VDB_0C(void) /* カ-ソル表示状態の読み取り */
- {
- U_AL = CUR_FLG;
- }
- void VDB_0D(void) /* カーソル位置の指定 */
- {
- CUR_X = U_DL - 1;
- CUR_Y = U_DH - 1;
- if ( CUR_X < 0 ) CUR_X = 0;
- if ( CUR_X >= SCR_X ) CUR_X = SCR_X - 1;
- if ( CUR_Y < 0 ) CUR_Y = 0;
- if ( CUR_Y >= MAX_Y ) CUR_Y = MAX_Y - 1;
- }
- void VDB_0E(void) /* カーソル位置の読み取り */
- {
- U_DL = CUR_X + 1;
- U_DH = CUR_Y + 1;
- }
- void VDB_0F(void) /* アトリビュートの設定 */
- {
- int at,x,y;
- union {
- UCHAR far *p;
- unsigned short s[2];
- } ptr,vrm;
-
- x = U_DL - 1;
- y = U_DH - 1;
-
- vrm.s[1] = CVRAM;
- vrm.s[0] = (x * 2 + (MAX_X * 2) * y + 1);
-
- ptr.s[1] = U_DS;
- ptr.s[0] = (U_DI + 1);
- at = *vrm.p & 0xC0;
- *vrm.p = at | (*ptr.p & 0x38) | (*(ptr.p+1) & 0x07);
- }
- void VDB_10(void) /* アトリビュートの読み取り */
- {
- int at,x,y;
- union {
- UCHAR far *p;
- unsigned short s[2];
- } ptr,vrm;
-
- x = U_DL - 1;
- y = U_DH - 1;
-
- vrm.s[1] = CVRAM;
- vrm.s[0] = (x * 2 + (MAX_X * 2) * y + 1);
- ptr.s[1] = U_DS;
- ptr.s[0] = U_DI;
-
- if ( (*vrm.p & 0x40) != 0 )
- *ptr.p = 0x01;
- else if ( x > 0 && (*(vrm.p-2) & 0x40) != 0 ) {
- *ptr.p = 0x03;
- vrm.p -= 2;
- } else
- *ptr.p = 0x00;
-
- *(++ptr.p) = *vrm.p & 0x38;
- *(++ptr.p) = *vrm.p & 0x07;
- }
- void VDB_11(void) /* デフォルトアトリビュ-トの設定 */
- {
- union {
- UCHAR far *p;
- unsigned short s[2];
- } ptr;
-
- ptr.s[0] = U_DI;
- ptr.s[1] = U_DS;
-
- COLOR = (*(++ptr.p) & 0x38);
- COLOR |= (*(++ptr.p) & 0x07);
- }
- void VDB_12(void) /* デフォルトアトリビュ-トの読み取り */
- {
- union {
- UCHAR far *p;
- unsigned short s[2];
- } ptr;
-
- ptr.s[0] = U_DI;
- ptr.s[1] = U_DS;
-
- *(++ptr.p) = COLOR & 0x38;
- *(++ptr.p) = COLOR & 0x07;
- }
- void VDB_13(void) /* 文字設定 */
- {
- int ch,x,y;
- union {
- UCHAR far *p;
- unsigned short s[2];
- } ptr;
-
- x = U_DL - 1;
- y = U_DH - 1;
- ch = U_BL;
-
- ptr.s[0] = (x * 2 + (MAX_X * 2) * y);
- ptr.s[1] = CVRAM;
-
- *(ptr.p++) = ch;
- if ( U_AL != 1 )
- *ptr.p = COLOR;
- else
- *ptr.p &= 0x3F;
- if ( U_BH == 0x01 )
- *ptr.p |= 0x40;
- else if ( U_BH == 0x03 ) {
- ch |= (*(ptr.p-3) << 8);
- *(ptr.p-1) = *(ptr.p-3) = DMYKAN;
- ptr.s[1] = KVRAM;
- *(ptr.p-3) = ch >> 8;
- *(ptr.p-2) = ch;
- }
- }
- void VDB_14(void) /* 文字読み取り */
- {
- int at,x,y;
- union {
- UCHAR far *p;
- unsigned short s[2];
- } ptr;
-
- x = U_DL - 1;
- y = U_DH - 1;
-
- ptr.s[1] = CVRAM;
- ptr.s[0] = (x * 2 + (MAX_X * 2) * y);
-
- if ( (*(ptr.p+1) & 0x40) != 0 ) {
- U_BH = 0x01;
- ptr.s[1] = KVRAM;
- U_BL = *ptr.p;
-
- } else if ( x > 0 && (*(ptr.p-1) & 0x40) != 0 ) {
- U_BH = 0x03;
- ptr.s[1] = KVRAM;
- U_BL = *(ptr.p-1);
-
- } else {
- U_BH = 0x00;
- U_BL = *ptr.p;
- }
- }
- void VDB_15(void) /* 矩形域設定 */
- {
- int cx,ch;
- int x1,y1,x2,y2;
- int x,y,sx,sy;
- union {
- UNSIG far *p;
- unsigned short s[2];
- } pp;
- union {
- UCHAR far *p;
- unsigned short s[2];
- } cp,ap,sp,vp;
-
- if ( (x1 = U_DL - 1) >= MAX_X || x1 < 0)
- goto ERROR;
- if ( (y1 = U_DH - 1) >= SCR_Y || y1 < 0 )
- goto ERROR;
- if ( (x2 = U_BL) > MAX_X )
- goto ERROR;
- if ( (y2 = U_BH) > SCR_Y )
- goto ERROR;
- sx = x2 - x1; sy = y2 - y1;
- if ( sx <= 0 || sy <= 0 )
- goto ERROR;
-
- sp.s[0] = (x1 * 2 + (MAX_X * 2) * y1);
- sp.s[1] = CVRAM;
-
- pp.s[0] = U_DI;
- pp.s[1] = U_DS;
-
- cp.s[0] = *(pp.p++);
- cp.s[1] = *(pp.p++);
-
- ap.s[0] = *(pp.p++);
- ap.s[1] = *(pp.p++);
-
- for ( y = 0 ; y < sy ; y++ ) {
- for ( x = 0,vp.p = sp.p ; x < sx ; x++ ) {
- *(vp.p++) = *(cp.p++);
- if ( *(ap.p++) == 0x03 ) {
- *(vp.p-2) |= 0x40;
- ch = *(vp.p-3) << 8 | *(vp.p-1);
- vp.s[1] = KVRAM;
- *(vp.p-3) = ch >> 8;
- *(vp.p-2) = ch;
- vp.s[1] = CVRAM;
- } else
- *vp.p &= 0x3F;
- if ( U_AL == 1 ) {
- *vp.p = *(ap.p++) & 0x38;
- *vp.p |= *(ap.p++) & 0x07;
- ap.p++;
- }
- vp.p++;
- }
- sp.p += (MAX_X * 2);
- }
- return;
- ERROR:
- U_AH = 0x02;
- U_CF |= 0x0001;
- }
- void VDB_16(void) /* 矩形域読み取り */
- {
- int i;
- int x1,y1,x2,y2;
- int x,y,sx,sy;
- union {
- UNSIG far *p;
- unsigned short s[2];
- } pp;
- union {
- UCHAR far *p;
- unsigned short s[2];
- } cp,ap,sp,vp;
-
- if ( (x1 = U_DL-1) >= MAX_X || x1 < 0)
- goto ERROR;
- if ( (y1 = U_DH-1) >= SCR_Y || y1 < 0 )
- goto ERROR;
- if ( (x2 = U_BL) > MAX_X )
- goto ERROR;
- if ( (y2 = U_BH) > SCR_Y )
- goto ERROR;
- sx = x2 - x1; sy = y2 - y1;
- if ( sx <= 0 || sy <= 0 )
- goto ERROR;
-
- sp.s[0] = (x1 * 2 + (MAX_X * 2) * y1);
- sp.s[1] = CVRAM;
-
- pp.s[0] = U_DI;
- pp.s[1] = U_DS;
-
- cp.s[0] = *(pp.p++);
- cp.s[1] = *(pp.p++);
-
- ap.s[0] = *(pp.p++);
- ap.s[1] = *(pp.p++);
-
- for ( y = 0 ; y < sy ; y++ ) {
- for ( x = 0,vp.p = sp.p ; x < sx ; x++ ) {
- *(cp.p++) = *(vp.p++);
- if ( (*vp.p & 0x40) != 0 ) {
- *(ap.p++) = 0x01;
- vp.s[1] = KVRAM;
- *(cp.p-1) = *(vp.p-1);
- vp.s[1] = CVRAM;
- } else if ( x > 0 && (*(vp.p-2) & 0x40) != 0 ) {
- *(ap.p++) = 0x03;
- vp.s[1] = KVRAM;
- *(cp.p-1) = *(vp.p-2);
- vp.s[1] = CVRAM;
- } else
- *(ap.p++) = 0x00;
- if ( U_AL == 1 ) {
- *(ap.p++) = *vp.p & 0x38;
- *(ap.p++) = *vp.p & 0x07;
- ap.p++;
- }
- vp.p++;
- }
- sp.p += (MAX_X * 2);
- }
- return;
- ERROR:
- U_AH = 0x02;
- U_CF |= 0x0001;
- }
- void VDB_17(void) /* 矩形域複写 */
- {
- int i;
- int x1,y1,x2,y2,x3,y3;
- int sx,sy;
- UNSIG sp;
- UNSIG dp;
-
- if ( (x1 = U_DL - 1) >= MAX_X || x1 < 0 )
- goto ERROR;
- if ( (y1 = U_DH - 1) >= SCR_Y || y1 < 0 )
- goto ERROR;
- if ( (x2 = U_BL) > MAX_X )
- goto ERROR;
- if ( (y2 = U_BH) > SCR_Y )
- goto ERROR;
- if ( (x3 = U_CL - 1) >= MAX_X || x3 < 0 )
- goto ERROR;
- if ( (y3 = U_CH - 1) >= SCR_Y || y3 < 0 )
- goto ERROR;
- sx = x2 - x1; sy = y2 - y1;
- if ( sx <= 0 || sy <= 0 )
- goto ERROR;
- if ( (x3 + sx) > MAX_X || (y3 + sy) > SCR_Y )
- goto ERROR;
-
- if ( sp < dp ) {
- sp = (x2 - 1) * 2 + (MAX_X * 2) * (y2 - 1);
- dp = (x3 + sx - 1) * 2 + (MAX_X * 2) * (y3 + sy - 1);
- for ( i = 0 ; i < sy ; i++ ) {
- vramrcpy(dp,sp,sx * 2);
- sp -= (MAX_X * 2);
- dp -= (MAX_X * 2);
- }
- } else {
- sp = x1 * 2 + (MAX_X * 2) * y1;
- dp = x3 * 2 + (MAX_X * 2) * y3;
- for ( i = 0 ; i < sy ; i++ ) {
- vramcpy(dp,sp,sx * 2);
- sp += (MAX_X * 2);
- dp += (MAX_X * 2);
- }
- }
- return;
- ERROR:
- U_AH = 0x02;
- U_CF |= 0x0001;
- }
- void VDB_18(void) /* 矩形域消去 */
- {
- int i;
- int x1,y1,x2,y2;
- int sx,sy;
- UNSIG sp;
-
- if ( (x1 = U_DL - 1) >= MAX_X || x1 < 0 )
- goto ERROR;
- if ( (y1 = U_DH - 1) >= SCR_Y || y1 < 0 )
- goto ERROR;
- if ( (x2 = U_BL) > MAX_X )
- goto ERROR;
- if ( (y2 = U_BH) > SCR_Y )
- goto ERROR;
- sx = x2 - x1; sy = y2 - y1;
- if ( sx <= 0 || sy <= 0 )
- goto ERROR;
- sp = (x1 * 2 + (MAX_X * 2) * y1);
-
- for ( i = 0 ; i < sy ; i++ ) {
- colset(sp,COLOR,sx * 2);
- sp += (MAX_X * 2);
- }
- return;
- ERROR:
- U_AH = 0x02;
- U_CF |= 0x0001;
- }
- void VDB_19(void) /* 全画面スクロ-ル */
- {
- int cx,i;
- UNSIG vp;
-
- if ( (cx = U_CX) == 0 || cx > SCR_Y )
- cx = SCR_Y;
- for ( ; cx > 0 ; cx-- ) {
- switch(U_AL) {
- case 1: /* 下方向 */
- i = (MAX_X * 2) * (SCR_Y - 1);
- vramrcpy(i + (MAX_X * 2 - 2),i - 2,i);
- colset(0,COLOR,(MAX_X * 2));
- break;
- case 2: /* 右方向 */
- i = (MAX_X * 2) * SCR_Y - 2;
- vramrcpy(i,i - 2,i);
- vp = 0;
- for ( i = 0 ; i < SCR_Y ; i++ ) {
- colset(vp,COLOR,2);
- vp += (MAX_X * 2);
- }
- break;
- case 3: /* 左方向 */
- vramcpy(0,2,(MAX_X * 2) * SCR_Y - 2);
- vp = (MAX_X * 2) - 2;
- for ( i = 0 ; i < SCR_Y ; i++ ) {
- colset(vp,COLOR,2);
- vp += (MAX_X * 2);
- }
- break;
- default: /* case 0 上方向 */
- vramcpy(0,(MAX_X * 2),(MAX_X * 2) * (SCR_Y - 1));
- colset((MAX_X * 2) * (SCR_Y - 1),COLOR,(MAX_X * 2));
- break;
- }
- }
- }
- void VDB_1A(void) /* 部分スクロ-ル */
- {
- int cx,i;
- int x1,y1,x2,y2;
- int sx,sy;
- UNSIG sp;
- UNSIG vp;
-
- if ( (x1 = U_DL - 1) >= MAX_X || x1 < 0 )
- goto ERROR;
- if ( (y1 = U_DH - 1) >= SCR_Y || y1 < 0 )
- goto ERROR;
- if ( (x2 = U_BL) > MAX_X )
- goto ERROR;
- if ( (y2 = U_BH) > SCR_Y )
- goto ERROR;
- sx = x2 - x1; sy = y2 - y1;
- if ( sx <= 0 || sy <= 0 )
- goto ERROR;
- sp = (x1 * 2 + (MAX_X * 2) * y1);
-
- if ( (cx = U_CX) == 0 || cx > sy )
- cx = sy;
- for ( ; cx > 0 ; cx-- ) {
- switch(U_AL) {
- case 1: /* 下方向 */
- vp = sp + (MAX_X * 2) * (sy - 1);
- for ( i = 0 ; i < (sy-1) ; i++ ) {
- vramcpy(vp,vp - (MAX_X * 2),sx * 2);
- vp -= (MAX_X * 2);
- }
- colset(sp,COLOR,sx * 2);
- break;
- case 2: /* 右方向 */
- vp = sp + (sx * 2) - 2;
- for ( i = 0 ; i < sy ; i++ ) {
- vramrcpy(vp,vp - 2,sx * 2 - 2);
- vp += (MAX_X * 2);
- }
- vp = sp;
- for ( i = 0 ; i < sy ; i++ ) {
- colset(vp,COLOR,2);
- vp += (MAX_X * 2);
- }
- break;
- case 3: /* 左方向 */
- vp = sp;
- for ( i = 0 ; i < sy ; i++ ) {
- vramcpy(vp,vp + 2,sx * 2 - 2);
- vp += (MAX_X * 2);
- }
- vp = sp + (sx * 2) - 2;
- for ( i = 0 ; i < sy ; i++ ) {
- colset(vp,COLOR,2);
- vp += (MAX_X * 2);
- }
- break;
- default: /* case 0 上方向 */
- for ( vp = sp,i = 0 ; i < (sy-1) ; i++ ) {
- vramcpy(vp,vp + (MAX_X * 2),sx * 2);
- vp += (MAX_X * 2);
- }
- colset(vp,COLOR,sx * 2);
- break;
- }
- }
- return;
- ERROR:
- U_AH = 0x02;
- U_CF |= 0x0001;
- }
- void VDB_1B(void) /* コンソ-ル機能の設定 */
- {
- int i;
-
- i = COM_MODE;
- COM_MODE = (U_AL & 0xC7) | 0x08;
- if ( (i & 0x40) != (COM_MODE & 0x40) ) {
- if ( (COM_MODE & 0x40) != 0 )
- SCR_Y--;
- else
- SCR_Y++;
- }
- }
- void VDB_1C(void) /* コンソ-ル機能の読み取り */
- {
- U_AL = COM_MODE;
- }
- void VDB_1D(void) /* 文字の出力 */
- {
- Chr_out(U_AL);
- }
- void VDB_1E(void) /* 文字列の出力 */
- {
- int i;
- union {
- UCHAR far *p;
- unsigned short s[2];
- } ptr;
-
- ptr.s[0] = U_DI;
- ptr.s[1] = U_DS;
-
- for ( i = U_CX ; i > 0 ; i-- )
- Chr_out(*(ptr.p++));
- }
- void VDB_1F(void) /* システム行書き込み */
- {
- int ch,cx,at,md;
- union {
- UNSIG far *p;
- unsigned short s[2];
- } pp;
- union {
- UCHAR far *p;
- unsigned short s[2];
- } cp,vp,ap;
-
- if ( (COM_MODE & 0x40) == 0 )
- return;
-
- pp.s[0] = U_DI;
- pp.s[1] = U_DS;
-
- cp.s[0] = *(pp.p++);
- cp.s[1] = *(pp.p++);
-
- ap.s[0] = *(pp.p++);
- ap.s[1] = *(pp.p++);
-
- vp.s[0] = ((U_DL & 0x7F) - 1) * 2 + (MAX_X * 2) * SCR_Y;
- vp.s[1] = CVRAM;
-
- cx = U_CX;
- for ( ; cx > 0 ; cx-- ) {
- *(vp.p++) = *(cp.p++);
- if ( U_AL != 1 ) {
- at = COLOR;
- md = *(ap.p++);
- } else {
- md = *(ap.p++);
- at = *(ap.p++) & 0x38;
- at |= (*(ap.p++) & 0x07); ap.p++;
- }
- *(vp.p++) = at;
- if ( md == 0x03 ) {
- ch = (*(vp.p-4) << 8) | *(vp.p-2);
- *(vp.p-4) = *(vp.p-2) = DMYKAN;
- *(vp.p-3) |= 0x40;
- vp.s[1] = KVRAM;
- *(vp.p-4) = ch >> 8;
- *(vp.p-3) = ch;
- vp.s[1] = CVRAM;
- }
- }
- }
- void VDB_20(void) /* 背景色の読み取り */
- {
- U_DX = BAKCOL;
- }
- void VDB_21(void) /* Ext Func Vram Cheng */
- {
- if ( ++DSP_CON >= MAX_CON )
- DSP_CON = 0;
-
- if ( DSP_CON != ACT_CON ) {
- ACT_CVRAM = consol[DSP_CON].cvram;
- ACT_KVRAM = consol[DSP_CON].kvram;
- CUR_DISP_X = consol[DSP_CON].cur_x;
- CUR_DISP_Y = consol[DSP_CON].cur_y;
- CUR_DISP_OFF = consol[DSP_CON].cur_off;
- CUR_DISP_SIZ = consol[DSP_CON].cur_siz;
- CUR_DISP_FLG = consol[DSP_CON].cur_flg;
- }
-
- CHK_VRAM = 1;
- }
-
- void BIOS_91(regset)
- register REGSET far *regset;
- {
- int cmd;
- REGSET far *regs_bak;
- CONPARA *actv_bak;
- static void (*VDB_table[])()={
- VDB_00, VDB_01, VDB_02, VDB_03, VDB_04, VDB_05, VDB_06, VDB_07,
- VDB_08, VDB_09, VDB_0A, VDB_0B, VDB_0C, VDB_0D, VDB_0E, VDB_0F,
- VDB_10, VDB_11, VDB_12, VDB_13, VDB_14, VDB_15, VDB_16, VDB_17,
- VDB_18, VDB_19, VDB_1A, VDB_1B, VDB_1C, VDB_1D, VDB_1E, VDB_1F,
- VDB_20, VDB_21 };
-
- regs_bak = regs;
- actv_bak = actv;
-
- regs = regset;
-
- if ( (ACT_CON = U_AH / 0x40) >= MAX_CON )
- goto ERROR;
-
- U_AH %= 0x40;
-
- actv = &(consol[ACT_CON]);
-
- if ( (cmd = U_AH) <= 0x21 ) {
- U_AH = 0;
- U_CF &= 0xFFFE;
- (*VDB_table[cmd])();
- } else
- goto ERROR;
-
- if ( DSP_CON == ACT_CON ) {
- ACT_CVRAM = CVRAM;
- ACT_KVRAM = KVRAM;
- CUR_DISP_X = CUR_X;
- CUR_DISP_Y = CUR_Y;
- CUR_DISP_OFF = CUR_OFF;
- CUR_DISP_SIZ = CUR_SIZ;
- CUR_DISP_FLG = CUR_FLG;
- if ( DSP_CON != 0 )
- CHK_VRAM = 1;
- }
- goto ENDOF;
-
- ERROR:
- U_AH = 0x01;
- U_CF |= 0x0001;
-
- ENDOF:
- regs = regs_bak;
- actv = actv_bak;
- return;
- }
- short Dummy_init(unsigned short seg,unsigned short cs)
- {
- actv = &(consol[1]);
- CVRAM = cs + seg;
- seg += 0x0100;
- KVRAM = cs + seg;
- seg += 0x0100;
- VDB_00();
- return seg;
- }
- void VDB_init(void)
- {
- actv = &(consol[1]);
- VDB_00();
- }